import React, { Component } from 'react'
import PropTypes from 'prop-types'

import Item from './../Item'

import "./index.css"

export default class List extends Component {
  static propTypes={
    acceptChecked: PropTypes.func.isRequired,
    remove: PropTypes.func.isRequired,
    todos: PropTypes.array.isRequired,
  }

  render() {
    const {todos, acceptChecked, remove} = this.props
    return (
      <ul className="list">
        {
          todos.map((e,i)=>{
            return <Item key={e.id} {...e} acceptChecked={acceptChecked} remove={remove} />
          })
        }
      </ul>
    )
  }
}
